package com.chia.multienty.core.dubbo.service.impl;

import com.chia.multienty.core.domain.condition.UserCondition;
import com.chia.multienty.core.domain.dto.TenantDTO;
import com.chia.multienty.core.dubbo.service.DubboMultientyUserService;
import com.chia.multienty.core.parameter.tenant.TenantDetailGetParameter;
import com.chia.multienty.core.pojo.Role;
import com.chia.multienty.core.service.RoleService;
import com.chia.multienty.core.service.TenantService;
import lombok.RequiredArgsConstructor;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Conditional;

@DubboService
@RequiredArgsConstructor
@Conditional(UserCondition.class)
public class DubboMultientyUserServiceImpl implements DubboMultientyUserService {
    @Autowired(required = false)
    private TenantService tenantService;
    @Autowired(required = false)
    private RoleService roleService;
    @Override
    public TenantDTO getTenant(TenantDetailGetParameter parameter) {
        return tenantService.getDetail(parameter);
    }
    @Override
    public Role getSuperTenantRole() {
        return roleService.getSuperTenant();
    }
}
